package cn.han.oop;
//本类用于汽车设计综合案例
public class TestCar {
    public static void main(String[] args) {
        car c = new car();
        System.out.println(c.getColor());
        c.start();
        c.stop();
        BMW b = new BMW();
        System.out.println(b.getColor());
        car c1 = new TSL();

    }
}
class car{
    private String brand;
    private String color;
    private int id;
    private double length;
    public void start(){
        System.out.println("启动");
    }
    public void stop(){
        System.out.println("停止");
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }
}
class BMW extends car{
    String color = "黑不溜秋的白";
    @Override
    public void start(){
        System.out.println("我要起飞");
    }
}

class TSL extends car{
    String color = "彩色的黑";
    @Override
    public void stop() {
        System.out.println("不想停");
    }
    public void swim(){
        System.out.println("潜水艇");
    }
}